<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>简洁代码生成键盘布局</title>
</head>
<body>
  <script>
    let o,m,n,l,b,w,y,p,k
    const str = (() => [..."`1234567890-=~~QWERTYUIOP[]\\~ASDFGHJKL;'~~ZXCVBNM,./~"]
    .map(x => (
        o += `/${
          b = '_'.repeat(
            w = x < y ? 2 :' 667699'[
              x = ["BS   ","TAB  ","CAPS  ","ENTER"][p++] || 'SHIFT   ',
              p
            ])
          }\\|`,
        m += y + (x + ' ').slice(0, w) + y + y,
        n += y + b + y + y, 
        l += ' __' + b
      )[73] 
      && (
        k.push(l, m, n, o),
        l = '',
        m = n = o = y
      ),
      m = n = o = y = '|',
      p = l = k = []
    )
    && k.join(`
    `))()

    console.log("result:\n",str);
  
  
  </script>
</body>
</html>